package com.gwm.item.service;

import com.gwm.common.enums.ExceptionEnums;
import com.gwm.common.exceptions.LyException;
import com.gwm.item.pojo.Item;
import org.springframework.stereotype.Service;

@Service
public class ItemService {


    public Item saveItem(Item item){
//        System.out.println("8888");
        if(item.getPrice()==null){
            throw new LyException(ExceptionEnums.ITEM_PRICE_NOT_NULL);
        }
        item.setId(100L);
        System.out.println("item = " + item);
        return item;
    }
}
